package receiver;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.MessageConsumer;
import javax.jms.Session;

import listener.MyInfoListener;

import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;

public class PTPConsumer {
	public static void main(String[] args) throws Exception{
		ConnectionFactory factory=new ActiveMQConnectionFactory("tcp://localhost:61616");
		Destination queue=new ActiveMQQueue("evan01");
		Connection con=factory.createConnection();
		con.start();
		Session sen=con.createSession(false, Session.AUTO_ACKNOWLEDGE);
		MessageConsumer consumer=sen.createConsumer(queue);
		consumer.setMessageListener(new MyInfoListener());
	}
}
